import { createApp } from "vue";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";

import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/dist/index.css";
import privateComponent from "@/components/index";
import EChartsPlugin from "./plugins/echarts";

import "element-plus/dist/index.css";
import "@/assets/icons/iconfont.css";
import "./assets/main.css";

// import {getCategoryAPI} from "./api/test"
// getCategoryAPI().then(res=>{
//     console.log(res)
// })

const app = createApp(App);

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);

app.use(privateComponent);
app.use(ElementPlus);
app.use(pinia);
app.use(router);
app.use(EChartsPlugin);

// 全局注册所有 ElementPlus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}

app.mount("#app");
